Python 3.4 encoding fixes