Fixed multiple problems with ECS allocation and segfaulting.