Fixed a bug in the string manipulation functions of libsimple-base that failed to handle string lengths properly.