Some fixes for compatibility with python3
3 files changed