Magnetic and crystallographic structural changes in ternacies of the type Er2Fe17C