#446
Needs testing, but I think this will work.