Fixed the way filenames without extensions are handled.