Fixed #4580 -- Renamed profile magic to profile_name

Trying to resolve #4580. Feel free to code review.