Fixed typos in lib/hooks.php. Stopped directly querying oc_share: When a user is removed from a group, or a group is deleted, check each if they still have access to each of the calendars they have preferences for, and removed unused preferences. Also, default preferences are now added when the calendar is first retrieved for the user, and no preferences exist.