Fixes and additions

- minor fixes
- added missing files to VisualStudio project
Fixes resulting from code analysis
Updated some lua functions
Merge remote-tracking branch 'origin/devel' into locations