Fixed issues found by static code analysis.
Added precompiled headers for faster build