Some Python 3 compatibility fixes; still need to fix coordinate_to_string