add duplicate flags settings and flag unset tests