Fixed looping
refs #368