Merge pull request #34 from Orvid/codeissuescleanup

Static Analysis Cleanup
build regressions
More cleanup