Flags cleanup