Remove type-unsafety from equals().