Fixed IDLE operation interruption
Merge pull request #656 from foxinushka/master

Fixed IDLE operation interruption
Fixed potential crash (fixed #658)
Improved IDLE interruption (#656)
Added sort array in place