[Cores] Revised with cppcheck

This is a mix of left over and new findings.
I've tested compilation under windows and linux.