Cosine similarity returns 0 when dividing by 0 in computation