Rewritten MobTypesManager not to leak memory.