buffer fixes