Improved closing the Environment (killing the window now kills the agents)