better fix for big-endian architectures