Maybe we should also check not only for node existence but also for the correct type?