More optimization to setOptions and setMetrics.

Updated tests and documentation.