Removed architecture from project_root var replacements. Added a comment describing the issue. Fixing TargetPlatform not initialized before executing script.