Flag verification

Not really sure what github is doing here... whatever. These commits contain the changes made to add verification of flag detection.