Various fix for 1.1.0

Tested against LUA 5.2.2 in Fedora 20 and LUA 5.1.4 in Fedora <= 19, RHEL-5 and RHEL-6
Build and test results are OK.