Add test to validate digit.

Fixes issue #49 backspace problem on Firefox.