Fixing sqlite group