Minor middleware updates to make moat work on Django>=1.5