Cleanups and Python 3 fixes

Here are some minor fixes I’ve been keeping to myself for too long :)