Fix legacy.lua