The nature of the first excited electronic state in MgF