fix a bunch of warnings
bugfix: legnth was not set when passing binary buffer fiedls to Lua