Merge "Fix valgrind imgdiag test failure / memory leak in runtime"