PEP 8 and other fixes