Fixed issue #57, order of middleware classes