The patch had an all to obvious bug when killing a buffer. Try the one attached here instead. But I have to think for a better solution in 'replace-buffer-in-windows'. martin