Middleware must clean up after itself (mostly: for tests)