Added missing buffer clearing.