Fix missing imports

While I'm here do some PEP8 cleanup.