Fixed small bug in getting node ids