fixes for django 1.2 support