remove debug printf

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
fix off-by-one error

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
add additional testcase

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>