Lua: Various improvements

Some stuff requested by R00Kie.
Why was this block taken out, out of curiosity?