lua: fix issue #1009