Fixed wait_all() error