Tentative fix for endianness bug.

This one is very important.

What has changed?
================
Just added the correct endianness to the reading of integers from the byte buffer. Interestingly, the buffer should already have the correct endianness, but it seems it does not!?