Backported r4357, r4358, r4360 and r4363 to r4367 from trunk.
Authored by: jplang 2010-11-27
Parent: [r4438]
Child: [r4440]