fix a stupid duplicate value checking bug (patch by Frédéric Moulins)