Cleanup code has been added for cancel function.  Empty network will be removed if merge task is canceled.