Use new set_bitfield function to handle swapping endianness.