Fix many off-by-one errors
2 files changed