Small fixes
Some freezing fixed
Merge pull request #370 from Nekotekina/master

Fixed some samples freeze