fixes #1658; fixes #1592
fixes #1468
fixes #1348
add resolved search for flags