Fix buffer length