Patches to get proper functionality with modified DDD and zero leaks, add optional