Added more safety checks to config loading for PolycodeProject