[Core] Fix some warnings reported by static analysis (c2546)