Finished Python3 compatibility