Fixed multi-tm generation bug. Changed to output to big endian.