Middleware should throw exceptions again instead of returning null

This still breaks with the tests, hope to fix in the next few days.