fixing dump/load to not do everything in memory