fix construction of conditional path queries

I broke this in the last flurry of refactors but, as is usually the case, I
have no idea why it ever worked before.