Fix #89, fix #103, fix #111, catch exception when reading config file