Fixed buffer overrun bug.