Fixed merger and orphan bugs