Fix compile error on gcc 4.8.3

The expression (1 << N) where N is an unsigned integer is considered signed
in gcc. This causes the build to fail due to a comparison between a signed
and unsigned expression.