Fixed buffer overflow error (hopefully)