small off by one bug in debug output