Minor fix in "waitForSync"