Django 1.5 + Python 3 fixes