fixed some problems based on ordinal order and name -> target mapping