Added additional config options and handled sub errors.