Ensured the correct cancel function was called.