More Python 3 compliance