For debugging, add leak checks