Use -URLByDeletingLastPathComponent instead

Leaves trailing slashes intact