Fixed logging bug when merging data