Fix off by 1 in debug output (there had been an off by 1 in cmd_words before)
Refactor the if out of get_set_int