buf fixes for deadlock