backwardcompat fixes for py3