Reworked saving and reading command from file.