[Core] Fixed various Code Analysis-related problems;