Code Analysis fixes