Fix errors in asynchronous example code