Fixing double-free