Fixed #579 migration to Django 1.6