Use declarations instead of checking types.
Correct definition of opt-order.