Simplify endianness detection logic.