Correctly selects filename when known extension with a dot inside is used