Added functionality to Lua.
Fixed a few text file issues.