merge lua, perl improvements by bapt and others