Fixed uninitialized cache. Return 0 instead of null when no similarity.