Added missing 'on_delete=SET_NULL' to some foreign keys