Residual stresses in PVD hard coatings