Fixes to the handling of path expressions