Fixed a bug with formatting digits less than 16.
Merge pull request #121 from mkononen/master

Fix to issue #120