removed unused variables

Change-Id: If1a7a522c0b225738f517ba53f1752f39677d4ea
fixed bug in handling diff

Change-Id: I5a4fe8b29916573283689e5073dc44fc3c34a2d6