Reordered to fix flag defs