[[ Bug 13968 ]] Make sure looping works within selection
Merge pull request #1464 from runrevpanos/bugfix-13968

[[ Bug 13968 ]] Make sure looping works within selection