Added additional loop tests and fixed a broken ifelse test.