I opened a bug report and created a diff that incorporated my changes. It's bug 1227. Patch has been uploaded.