Make option handling code more standard.