Fixed a potential bug of using node names.