Removed unused code
Improved tests for resource merging