End effects in thermoelasticity