Added endianness conversions to build functions