Re-applying change to code from r106516