Add --check-leaks for test
Fix leaks