Fixed some issues with generic datastructure use