null checks. ApplicationName added.