Fixed crash introduced in d3c4685a966a31c4fada0730931ebd5db7b19f72 & 2d588b72ceb73eecd90478f98cd13168ff04a25c,

Condense some messages, minor linting and PEP 8, add FIXME, TODO, and
OPTIMIZE comments mainly pertaining to v1.2 rewrite, (#number) refers to
GitHub issue number