Fixed #349: Performance improvement for loops creation/supression
Fixed #350