Minor bugfix in buffer handling when buffer is full.