Adhesion and hardness of ion-plated TiC and TiN coatings