Fix a traceback when sorting a listwin