Improve the AST traversal and the test coverage.