Check against invalid target names after parsing rather than when we run the job

Change-Id: I354407fb18289cf18134fb7466259f434330f6a8
Merge "Check against invalid target names after parsing rather than when we run the job"