Used proper calculation for body's span (when using AST as the argument in compile)