Merge redundant loops.
Merge branch 'master' into enhancement/13_matlab_to_cpp