Fork for pypi.
Fixed error logging.