Removing the last major issues about code styling in CMA-ES.

Prefer to use $Math.min(i,j)$ rather than your own method.