Fixed segfault bug on odd-length string inputs.