- ts3 bugfix and iterator fix

- on-purpose off-by-one