Backout rest of 8d16c92e1bf4 (bug 827801) to fix the build on a CLOSED TREE