Improving debug mode