Fixes for Python3