Improved cooling func, including sign fix.