Misc. py3+ fixes and @thobbs if/else/elif fix.