fixed two bugs in diffing