fix "comparison of unsigned expression < 0 is always false"