Removing duplicates in app groups

Patch for issue #1