fix some bugs for lua-tests