Added script output redirection and passing of params