updated to the latest patch from bug 820524. fixes for bug 808370. rebased the patch for bug 759351