Reduce block range to range that is actually displaying, avoids endless loop
Added extra precautionary check.
fixes #442
Merge branch 'od/issue_442' into develop