Fix unsafe use of BaseNode