Fixed links count calculation