Workable fix for #550: Range expressions behaving badly.
Merge pull request #627 from rojepp/550

Workable fix for #550: Range expressions behaving badly.