Data structure fixes