Fixed some buffer overflow