Fixed potential for off-by-one error in `print` function.