bug fix: segfault because of an early data deletion, there was also an inconsistency between the data size and counted index.