[UPD] Some speed optimizations
Merge pull request #1 from micazeve/master

[UPD] Some speed optimizations

Thanks @micazeve. Merging...