Modifications to support Django 1.4.