Fixed error when saving a measurement