Fix bogus unsigned to signed int conversion.

This leads to failures of computing VIA branches when hash label is higer than 2^31