general improvements and bugfixes; Lua 5.2 mimicking