Fixing flag processing when flag is lost.