Fixes for the patch...
Added testcases but it's broken - numbers come out dec, etc.