Fix float error when value is None