fixed removing not existing documents in groups (fixes #28, 34)