Strip trailing slashes on non-directories