Corrosion resistant surface for vanadium nitride and hafnium nitride layers as function of grain size