Improved debugging mode