Various fixes and support for latest Django versions.