Cleanups in preparation for Django 1.6