Fix bug related to high memory usage and slowdown in production
Merge branch 'hotfix/0.5.1'