Fix frame number reported to Lua in repaint after load