Unexpected results with bit shift

Cast the byte to an appropriate width