Fixed bugs in middleware