Improve removal of temporary buffers during publishing.