Fix the define residue_num_iterator
Fixed bug with get_node_from_res..., the collapsing of stems with degenerate loops, and intermediate dirs set to None