patch for bug 865792. another patch for bug 893943