Resolved some minor issues identified by Microsoft Code Analysis