Resolved a problem when changing from N digit number to a N-1 one