The Enterprise in the process of transporting Mikulak biological tissue samples intended for use in combating an epidemic of Correllium fever on Nahmi IV. The transport of the samples is delicate, and when they find one of the sample containers is leaking, they are forced to destroy it to prevent the contamination of the other samples. LaForge tells Riker he is concerned that one of his engineers, Reginald Barclay, has been underperforming and notes that he is late to help with the sample transport. What LaForge does not realize is that Barclay has been in the holodeck acting in a simulation of other Enterprise crew members, avoiding contact with their real counterparts. LaForge requests that Barclay be transferred from the Enterprise but Picard recommends that LaForge take Barclay on as a "pet project".
LaForge works at supporting Barclay as their team works to investigate the failure of unconnected systems around the ship. Picard invites Barclay to a bridge meeting to review the investigation, but slips up and accidentally calls him "Broccoli", a nickname given to him by the crew. Barclay later returns to the holodeck to seek refuge in the simulated version of the bridge members. In talking to LaForge, Guinan suggests that Barclay is simply imaginative and that LaForge keep a more open mind towards him. On her advice, LaForge visits Barclay on the holodeck and discovers the exaggerated simulation of the bridge crew. LaForge suggests Barclay get counseling from Troi, whose counterpart on the holodeck displays clear signs of sexual attraction towards Barclay. Barclay attempts to take the real Troi's advice, but ends the counseling session short and returns to the holodeck. LaForge shows Barclay's simulation to Riker and Troi to illustrate the extent of the problem.
Suddenly, the Enterprise mysteriously accelerates to warp speeds, and Riker, LaForge, and Barclay go to Engineering to discover the matter/anti-matter injectors have jammed; the ship will continue to accelerate until its structural integrity collapses unless the injectors are cleared. The team is unable to come up with any immediate solutions that will work in the limited time they have, but Barclay realizes all the failures they have seen have been connected by a human element: a member of LaForge's Engineering team has been present at each incident. This allows them to reduce the possible contaminants from 15,000 to 2. The contamination that has been interfering with the systems is quickly discovered to be invidium, which was used as part of the Mikulak samples. They are able to quickly repair the injectors, stop the ship, and set course for a nearby starbase to remove the rest of the invidium contamination. LaForge commends Barclay for his contribution in saving the ship. Barclay returns one more time to the holodeck and addresses the simulated bridge crew, believing it best he leave them, and then deletes all but one of his holodeck programs.