Fixed errors handling for python2.
Respect PEPs.
More logging.
Merge pull request #11 from Dipsomaniac/master

Fixed errors handling for python2.