Change matching in parser to look up tree
Fix tests