Fix a bug in Stats.minBy.

The implementation should use Seq.minBy instead of Seq.maxBy. This PR fixes it.