Fix overflow issue without shim

I think this meets the requirements for fixing #15. Please test and let me know.