Fix fencepost error in addition algorithm