Fixed big-endian bug and added test interface.