Fixed some intricacies of ordering sends and waits.