Fix class comparisons for things like the provider param

Addresses the issue discussed in #447 with the suggested solution.