Bugfixes for digits.py.