fix: use isinstance for argument type checking

Because OOP is hard.

Reported-by: hbc