fix various 'comparison of integers of different signs' compiling errors under macosx