Fix signed/unsigned comparison warnings
Fix unused value warnings