removing trailing whitespace
flush handlers so they actually run before generating a config.