Fix for newer Pythons