Fix null occurrences during AST building