Fix off-by-one error. Fixes issue #4