Added support for both cancel_sm and response and query_sm and response.