fixes for the dispatcher and middleware tests