some bugfixes in order to work with django-1.5