fixed a bug or two with test data. Still needs to be tried out.
fixed callsam