Fix more scalability issues
Merge pull request #2 from Daniel-Hug/master