Fix buffer overflow. (fixes #19)