Fix for recent commits which were causing a number of tests to fail in Python 3.