Support for newer django version
Bugfix for Django > 1.4
Bugfixes for new django