Py3 compatibility and small corrections.