Fix: punctuation capitalization inference on short queries
Parameters `margin` and `step` are adjusted if all input sequences are short, but this adjustment was done wrongly. Parameter `step` could have become less or equal to zero.

Closes #2992 