make option handling more robust.