Preventing division by 0 in arrow calculations