A couple of python 3 fixes

Requires Django 1.4.2+ as bundled six module is used.