Nov 22 Eric EOD Commit

Problems occuring with end cases when endrepeat >=1. Check that looping
correctly?