added missing flagEndAsync

Sorry about the changes caused by my formatter. The actual code changes I made are at (new) line numbers 455, 470, and 497.