Fixed leak in test case