AST pattern matching return table bug fix