When a user choooses to execute to a named profile (not: named child), make sure to get the profile filename in the correct way to avoid a crash.
Fixes: #314 (closed)
I propose this patch for 2.13..master. (Note: I verified that the bug already exists in 2.13, and that this patch fixes it.)