Add clean-buffer function.