Changed how the panel is cleared (now slightly intelligent)