Fix #19 again: numbuttons is an int, so we should also cast to int and not to uint.