Avoid some cleanup errors on closing
Improve debug view of sidebar