ticket:3 t3_middleware tests fixes