Fix for endianess
Fixed endianness
Tweaks (uncomitted from last week)