Recover from errors in queries