The offside wasn't offside. You can only be offside if the ball is played forward by your own team mates. Bernardo didn't play the ball to aguero, it deflected off his foot. Had that been the other way around being a deflection back to the keeper, would the ref deem it a back pass had the keeper...