Fix for Cuda memory issue when running multiple times
Merge branch 'wip-develop' into develop