Improve and fix temperature update