Improved the diagnostics.