Additional error checking when saving the buffer contents