Prevent infinite loop loading config files.

PR#2985