Shorten lines and PEP8 fixes