Update code to work with Python 3.4 as well.