Fix Python 3 failures