fixes for compatibility with python 3