Fixed broken CosineDistance examples.

The examples for Cosine Distance are broken in a few places.  I believe this branch fixes the errors.