Improve compact functionality to update the modified column.