Removed some ifCanceled() checks. Also an uneeded cast.