py3 compatibility changes