Fixed Python 3 failures