Added ability to clear buffer.