Solved bug at adjust_range for matrix