I'm not certain what was up with Andy in that first set. Juan was certainly playing well and maybe that caught Andy off guard. After that he seemed to loose his rag a bit and made matters worse for himself by finding the net far too often. That might have been the end of the match for the old Andy. But at the start of the second set he'd calmed down, adjusted his game and found his focus again.
Though there were a few moments in the 2nd and 3rd sets where he was clearly being put under pressure by his opponent. The new calmer Andy was able to deal with this and win through.
If he hadn't, there would have been very little British tennis interest at all next week.