Fixed a few bugs when loading configuration files.