MAINT: use solve_triangular when applicable