Fix null root checking. Fixes #7