fixed bug in error message
and removed explicit adding of 0 to buf
in say func