Fixed string escaping in AGI commands and parenthesis trimming from results.