Correct bugs with transmit.c. It now seems to work properly.