Fixed a bug in saving of command file