Fix crash on opening files without extensions.