fixed errors after updating to django 1.6