Active temperature compensation