Fix build on big endian architectures.

Update of #670