Fixed memory leaks when StfsPackage throws exception