Remove warnings about delete method

The parameter was taking a CKIModel *, but really just wanting a class.
Remove some warnings with shadowed inner variables

task was an inner variable being shadowed by an outer variable. Twice.
Fixed this problem, and got rid of a warning by casting