Some minor cleanup before I tie Lua into a scripting manager.