Make cmd line command handling more robust.