Issue 'Possible resource leaks detected' fix