fix crash on change domains while entities are animating or moving
fix various crashes in entites
Merge pull request #3372 from ZappoMan/entitiesCrashes

Fixes the several entity crashes