fixes to support python3