CRM-13550 improve handling of options