Some flag cleanup