Fixed mistake with the link count calculation