fix some compiler warnings (signed/unsigned comparison)