Fixing gcc491 compilation

Fixing signed to unsigned comparison error for gcc 4.9.1.