Reinstating r181091 and r181106 with fix for Linux regressions.