Properly handle modified files