Generalize is_similar() to take array refs and fixed some tests.