Patch 1 fixes incorrect target feature gating - ok for master and backport to the branch? The remaining patches are some minor improvements that I noticed while reviewing the rest of the original patch - ok for master?