The top value was off by 1: in order to count n ticks it has to be set to n-1. Fixes issue #8122.
Attach a file by drag & drop or click to upload