Made the C/C++ side more suited for lua inclusion
Fixed merge issue