Fixes bug around MERGE inside a FOREACH inside a FOREACH
Allows MERGE to be used with no known points
Merge pull request #1707 from systay/merge-fixes

Fixes bugs around MERGE