Fix NOT precedence

And reorder Expression2 to ensure pattern expressions are considered
before expressions in parenthesis
Merge pull request #1117 from cleishm/not_fix

Fix NOT precedence