Add fixes from bug 975831