length arg of byteSubstr is now optional