Fix KeyError in Tests/test_file_xpm.py