Moving toward Python 3 compatibility