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