Merge: Fix type adaptation when there is loops