Fixed return being ignored in loops.