Fix -Wsign-compare warnings
Fix -Wsometimes-uninitialized warnings