Fix a bug where the measured data wasn't being stored into correct variables