Fix diagnose command output
Merge pull request #1779 from smasty/fix-diagnose

Fix 'diagnose' command output and error