Improved the diagnostics