Also take array limits into account when testing for equality