Changes from patch for bug 917963

Changes from patch for https://bugzilla.mozilla.org/show_bug.cgi?id=917963