Fixed sometimes crash when removing last digit.
Merge pull request #50 from antonjn/master

Fixed sometimes crash when removing last digit.