Made some fixes for Django 1.5. Removed support for Django 1.4.