Fix query rewriting issue

Do not try to optimize range expressions using reverse axis step. Closes #248.