Removing empty commands from the commands list.