A minor change set, only warning fixes and enabling of the warnings in CMakeLists.txt

I decided to split the changes this time. This pull request contains only the warnings-related changes without affecting any actual logic.