Update to match latest changes in my patch for issue 486.