This is wrong (breaks lots of stuff). I'll have to fix things in a different way.