Cleanup, python 3 fixes