I don't know if it's because of where I live (over 7,000 feet), but if I boil eggs for only 5-7 minutes the yolks are still runny. Mine have to be boiled for 13-16 minutes to be hard boiled. That said, 40 minutes is a REALLY long time. Everyone else has adequately explained the green ring, it just happens when they get overcooked.
I'm curious, did you eat them?
"It is not the critic who counts; not the man who points out how the strong man stumbles, or where the doer of deeds could have done them better. The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood; who strives valiantly..."