bytes fixes for py3