Fix more missing variables

Hmm, `$this` would be a class, but I guess this could not be the case, depending on how the developer is using the library.