Fixed memory problems with ECS system structure.