Fix buffer overrun