[BUGFIX] Stop merging root line variables when invalid pages are encountered

Fixes: #292