Fix a number of clang -Wsign-compare warnings that didn't have an obvious