Buffer bugfix