Fix compilation and adding back the measurement and relationship terms