Fixed regression after changing resource node index by name
Added defensive code to avoid using undef when hashrefs expected

 * Also removed unused sub
Fixed condition to move one resource from a node to a different one