Added a mechanism for clearing the diagnostics of the non-active contexts. Improved the command diagnostic mechanism to make the warnings appear more consistently. Fixed duplicated command diagnostics.