General bug fixes and Django 1.5 updates