Issue/472/django1.5

My fixes for Django 1.5 compatibility, as discussed on the mailing list.