Cherry pick luascripting fix from Master to Release branch