Added cleanup to each, and test for each