Check if TopLevelNodes is empty
Fixes #412