Team IDs are not removed from User entity after team deletion

Fixes #500