fix more bugs in dedup