Fix -Wsign-compare warnings from gcc