Fix waiting, and error propagation.