Fix setting of FLAG_DOID and buglet from last commit.