Datastructure fixes