data handling fixes