Check all targetList values.
Use strcmp instead of strncmp for target name.