Fixed bugs in ECS - seems to be mostly working now