fix #2004: do not allow backwards ranges