Several optimizations
Merge origin/master