May be the second problem is caused by possibly wrong check in TMG?
template<class T>
bool
TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff)
{
if(!i_target.isValid())
return false;
if( !&owner || !owner.isAlive())
return true;
The first problem solution is wrong I guess because this two effects using two different generators. They are pushed into stack and active is always the upper one. So the point of problem is else where.
If you apply fear and after it death coil. It push on stack FleeMG and than ConfuseMG. If fear is done before Death Coil
else
{
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
GetMotionMaster()->MovementExpired(false);
and this will expire wrong MovementGenerator. Because the confused one is on the top and than
if(getVictim())
GetMotionMaster()->MoveChase(getVictim());
we will immediately mutate into chase so the ConfusedMG is still the second on stack. When Death coil is done TargetMovementGenerator is expired and FearMG appear on stack but UNIT STATE is not set eny more so we will mutate into Chase again. At this point it is totaly messed up So I think correct solution sould be on aura remove always correctly remove certain MG where ever it is in stack.
But may be my calculations are wong I am almost two days without sleep ...