Multiple fixes:

- Fixed incorrect case in some header includes
- Added missing header includes
- Added missing "this->" in some template code
- Added a function definition that is undefined in non Visual Studio libraries.