Add handleable middleware and some more test cases.