added more checks on availability of node_t
reorganised imports