Fix assembling of data for saving.