Some minor changes to the datahandling