Fix a conversion bug; update test.lua to catch the bug