Added checks for null or empty map, and rewrote generated AST