Extended the profile information to list group memberships
Fixed a SQL query for use with PostgreSQL