Fixed adjust_matrix