Added tests for duplicated flag check.