Fixed an off-by-one bug in previous commit.