minc overshoots dimension-wise. loop iterations fixed