Add better test for delete function in batch layer, and fix handling of known items