Modify tests to avoid mutating Cosmos