Fixes in order to write correct raw-data on big-endian platforms (Marco)