Revised RemoveUpstreamUnit() to be able to remove units with sidestreams