Fix crash on length() for nodes