Various tweaks and hopefully improvements to file change detection