Applied patch from r5528:5529
Patched with r5531 changes