Adding protections to avoid segmentation violations

* On method Scale(map<PlotIndex,double> weights): only elements on weights that match elements on this map are used.
* On method getMerged(string name, vector<PlotIndex> selection) if selection has elements that do not match elements present on map those are ignored and an error is sent to command line.