Improvements to compensated temperature code