fix for query iteration with 1 < step
Fix a segfault on 32bit platforms