Fixes to make it Django 1.6.x compatible