Added support for canceling and compiled statement.