This line is a little odd... do you mean to write

    $this->debug = $kwargs['debug'];