Fix some gcc warnings.

Fix some gcc warnings (mismatch order in initializer and unsigned/signed comparison).