Fix more errors with other Django middleware