Fixed digit duplication bugs.