landed patch for bug 877199. new patches for bugs 866950 and 877778