Use the length of bytes written in the toString command so we don't end up with extra characters.