Fixes for the duplicate problem.