Fix for issue #19

Now cosine similarity throw an InvalidArgumentException instead of
performing division by zero