RP-132 Fix overflow

I can tack it onto my bulletproofing ticket, since testing will require some refactoring due to the static calls in horizon lib.