More protection in solve (this should solve bug #26734) (seggested by P.H.)