Properly set `type` and `handle`

The instance variables are set from the class method `run`. They need to be set in the constructor.