Fixed bug in string to buffer.