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