Fix for a build error when using the --appConfigLayer option and a layer name included in the build profile.
(cherry picked from commit 121d611d65d570b647f2760dc759dd342c56b25a)