Fixed memory leak
Merge branch 'master' into barz-master