reverse range with select gives empty result. fixes #6534