bug fixes and cancellation changes