fix off-by-one in testfile generator