Fixed mainly signed/unsigned issues found by SGI cc in -fullwarn mode.