Improve tests, remove duplication and correct collection persistence test