Improve endianness code portability