Don't attempt to remove path extension if the object is a folder.