Bugs 878387, 878168, 876891: fix three closely related auto-correct bugs
Merge pull request #10155 from davidflanagan/bug876891

Bugs 878387, 878168, 876891: fix three closely related auto-correct bugs. r=janjongboom