Avoid signed vs unsigned compare warnings. From Dimitry Andric.