Fixed NPE when there are no matches
Changed PatternNode order
Merge remote-tracking branch 'origin/master'