Adds cleanup, context mgmt and patches test.