Changes for running with django 1.5