fixing some bugs ... in the mapper and in the model output