Minor sql queries.
Adding unsubscribe user to session/course option see BT#6845 + Fixing course id in query.