Added identity association. Fixed some bugs made during earlier integrations