patched hseq to handle negative increments properly