Use path separator in queryIsLastPathSegment