Removed some hacks incompatible with django 1.7.