Get rid of the extra NUL at the end of buffers