Issue #57: test cases for off-by-1