Fixed a bug with choosing estimates in the metrics function.