Fix string index out of range doing catch_up

This fixes bitcoin-abe issue #34