Reworked debug mode