Fix a bug that broke backwards compatibility with 1.7.4
Figured out how to get manage.py test, shell and dumpdata working.