Lua version of fnull function.