Fixes for PY3