Updated to deal with erroptname more completely