Clean up context middleware