Functioning of Rating Agencies: Lessons to be learned