Add failing test
Fix for failing test
Fix memory leak