ensure machines.yml is saved immediately after changed. Few minor fixes