Some lua fixes

see commit messages