A couple of fixes and django 1.5 compat