Still trying to get L2 distance to work.  There might be a bug, with both cosine and L2.  Not sure.