Improved the update algorithm to also check last modified dates.