Better Test-TargetResource. Other minor changes.