Convert byte encoding to host byte order

Correctly convert byte encoding for 32bit value from little-endian order
to host byte order.
Merge pull request #97 from carnil/master

Convert byte encoding to host byte order