Rename sort of seems to work; there may still be bugs though...