Small code analysis fixes

Just starting out with some small code analysis fixes