Revert patch for linebuf.
Various fixes.