Fix killing buffers after playing with layouts