Add a typecheck for the endianness conversions