buf fixes and enhancements