Improved error message in add_measurement and minor formatting changes.
Fixed tests with new refactored model API
The group scale factors is still not working correctly