Fixed distinct bug.