Corrected endianness checking