Fixed couple bugs and memory leaks from panels