fix #1487 (marker placement when spacing < width) and add tests