Fixes #395

ThisShouldNotHappenError when using path expressions in predicates for certain patterns