Some minor improvements to the MainCommand code.