Fix for endianness (bug #1174)