Fixed potential crash in profile.