AST transformation fixes