Properly return buffers and handle errors properly in cb.