fix off-by one bug when looking for bonds.
(cherry picked from commit fc5db8a737be35adce95121f4222bdca2eb1a384)