Fixed the friends function.