After resetting a buffer add a single empty string to avoid 'undefined' errors