[core] Fix signed/unsigned comparison warnings