A small patch to make the selected window one of the siblings when the selected window is deleted. I do not understand the code so I am not sure this is correct. Martin?