Fix handling of repeat with no following statement
Add test of rsh
Fix handling of Repeat