More fixes for duplicate friends #987 #1002