Improved python3 compatibility of the package.