Fixed the duplication of students, added .select('summer_students.id').uniq to all queries.