The treatment of the Hulk's character was one of the few highlights of the film.  Sorry if I chalked that almost entirely up to Ruffalo's performance.  I guess there has to be an element of script involved.  
I'm not going to be seeing the movie again - so, just now, in endeavoring to recall all I can about Dr. Banner's part - it was all pretty much standard Banner as the character has been established in comics and prior movies. Really, the difference was 97.3% Ruffalo.  I'll grant Joss the remaining percentage. 
 
 
But, really, I'm not here to bash Joss Whedon.  I've heard great things about 
Buffy, and I loved 
Firefly and 
Cabin in the Woods.  So I'm just gonna personally consider 
The Avengers a misfire - a hugely financially successful misfire - from a talented man.