More optimizations and minor bug fixes in file_changes.