Cleanup and PEP compatibility

Signed-off-by: Thomas Spycher <tspycher@zerodine.com>