Improvements for diff