Fixes to substring and friends.