Python 2 fixes and various.