Fix for handle leaks