Fix and improve debug view