Avoid out-of-range marker position (Bug#12426).