Mostly PEP8 compliance, minor bug fix and type kind output in error condition