Fixed AST handling of variables declared inside a functions main block