Fix the functionality for planning mode and saving of commands