Bug 1070200 redo

re-instate Will's PR as I accidentally clobbered his commit in a rebase.