Fixed a small error when dealing with the digits