Fix some buffer overflow