Fixed bug on cleanup after config file error