Fix problem that certificates are generated for users not being members of a course