fixes #5923

and a few other range issues
Merge pull request #5951 from Walter0o/diona_range

fixes #5923