Fix class comparisons for things like the provider param

Addresses the issue discussed in #447 with the suggested solution.
I think we should use `if`, `elsif` here. I don't see the advantage of a case statement since we are switching on different targets. Also, a short comment about why we treat classes differently would be helpful :smile:.