Fixing issue where sensor values were not properly cached for min and max