HSCAN/ZSCAN: skip value when matching.

This fixes issue #1360 and #1362.