Faster Exact Algorithms for Some Terminal Set Problems