Removing extensions when they should be filenames