AddReferenceTest and better EntryStorage emptying