Add a test
Fix a globalleak