Fix bugs in the run script and its helper function
This MR fixes run script and the helper function get_task_subset_by_type
used in the run script. It also adds instructions for running the agent when evaluation environment variables are provided in the terminal or to the container.