Making the dump() function work with empty buffers