Fix the equal function

It failed on comparison of String objects with other String objects or
string primitive.