Handle dirty files gracefully