Fixes to catch up tcr-colonyjit branch.

Watch integer overflow. Would be better to reset the counter to 0 and compare to a constant.