Fixing a few things that broke Python3 compatibility