More fixes

a lot of the .subString() needed another +1 because the 2nd argument is
exclusive.