Working on performance issues and minor bugs in the diff methods