Fixed some issues with python3.