endless bugfixes with measurement model, should finally work now.