Added --wait option to queue.