Fixed erroneous return with a continue

This bug stopped the flushing of the event queue by returning too early