Fixes and compatibility checks with Django 1.6.1