Fixes bug in code after for loop. For loops are now non-atomic.