fix the handling of options