Some fixes for 1.4 django migration.