Fix functions because of earlier data structure changes