Fix some weird things in legacy