Merge branch 'master' into develop
Fix a memory leak
More tests and minor fixes