fixes multiple section issues, adds better checking for files and config