Changed usage of Model to MapModel. Fixed nullpointer.