Fix bug in endian convert functions
Fixed bug in the conversion functions for big endian platforms.
Reported-by Martin Hundebøll <mhu@es.aau.dk>.