patches for bug 861495