Fix: check 'res' inside backends "probe loop".

so that if it's falsy we continue with the next backend.
state_history mostly done. TO BE CHECKED..