Fix in Merge and DB stability

Thanks to Necro for bringing these changes to my attention!