Some fixes in Measurer and Mathematician to avoid segmentation faults