fix setting variables that get passed through `run`

I use the writer to set the variable if that is available and then fall
back to setting the instance variable otherwise. This allows for read
only attributes to be manually created when they don't need the casting
that comes with using the attribute methods (i.e. integer, boolean,
etc).