Added little / big endian support.
Fixed too long result.