Don't crash on moving to a nonexistent group

Fixes #360