Handling of plugs of fluid surrounded by immiscible fluid