Fixed broken legacy code