Fixed initialization type when passing a path to the config file and not file-like obj.