more buffer fixes