fixed some corner cases for saving to nested config files