Fix warnings about comparing signed with unsigned values