add additional unigned int casts to deal with be_t conversion ambiguity