PEP8 and python3 fixes