rebases for bug 760876 and more test fixes