avoid signed-unsigned comparison warnings