Runtime loop changed
Some optimizations