fix for merge and extract method

- treeset.addall threw cast exception
- fix will now merge file correctly