Fixing bug with renaming of dependencies pointing to peers

Hello sho, 

Please review the following commits I made in branch 'jeremy-bugs'.

82650b7c07e6d279c6f7e49d08b266350e779bb6 (2013-02-26 13:42:32 -0800)
Fixing bug with renaming of dependencies pointing to peers

R=sho