off-by-one error on sensor number upper limit. tested on win