fix signed comparsion warning

Fixing warning introduced by #586.