...I don't think Gary is quite super-super nice. (Although, he has gotten a lot nicer), and when he is mean to Ash...I think he has some sort of a purpose. Like, after the Battle Frontier, I think he treated Ash the way he did because he didn't want Ash's ego flying all over the place...
But I think he became nice because he realized that being egotistical makes you kinda...well, not that nice of a person, and he just realized...that he had to grow up. Or something.
although we'll never know exactly why, because I doubt the creators of the show even really know, to be honest...:'D
also lol who is Wonn--I'm kidding. xDD