Fix duplicate avoiding code.