Fix syntax problems in update last measurement function