PEP8 compliance and minor code tweaks.