fixed make_matrix_solveable to avoid infinite loop