More legacy code fixes