Changes to enable more tests to pass in Python3