fix signs in endian conversion