remove trailing whitespace
improve exception when config settings are missing