Oops.

Yes, I really should test this (was supposed to be for comment on the approach rather than ready for merge..)