Fix step histogram endline

Fix #2365.

This was a simple off-by-one error (hat tip to @nicolaschotard for finding the bug as well as reporting it). I added a new test that should catch this if it pops up again.