Fix for subpath detection