Fixed bug 2786 duplicate problems