Fixed mutation of code array on repeat