fix bug in getComponents, return nodes in the format the user requested