Fixed a bug with resource merging.