Add more tests for __debugInfo() and fix leak