Fixes for the python module to work with python3.