added auto-casting of options.