Make sure that config files are closed properly