Fixing signed x unsigned comparison for gcc 4.7

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>