Code analysis violation fixes