Added detection for double folds