Fixed buffer overflow bug.