fix compile warnings about signedness