Fixed ConfigManager test and some bugfixes.