Merge "Some fixes for supporting python3"