Unit tests and fixes for the endian converter.