ResourcePath: Unify path checking a bit