Some static code analysis which led to some code cleanup.