Long have to be compared using equals
(cherry picked from commit d4256b2ef9057902f1ac1a1420c5786609424edb)