Syntax and PEP8 fixes